<%@ page import="org.bjou.Course" %>



<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'credit', 'error')} ">
	<label for="credit">
		<g:message code="course.credit.label" default="Credit" />
		
	</label>
	<g:field type="number" name="credit" value="${fieldValue(bean: courseInstance, field: 'credit')}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'courseType', 'error')} ">
	<label for="courseType">
		<g:message code="course.courseType.label" default="Course Type" />
		
	</label>
	<g:textField name="courseType" value="${courseInstance?.courseType}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'courseProperty', 'error')} ">
	<label for="courseProperty">
		<g:message code="course.courseProperty.label" default="Course Property" />
		
	</label>
	<g:textField name="courseProperty" value="${courseInstance?.courseProperty}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'courseId', 'error')} ">
	<label for="courseId">
		<g:message code="course.courseId.label" default="Course Id" />
		
	</label>
	<g:textField name="courseId" value="${courseInstance?.courseId}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'courseName', 'error')} ">
	<label for="courseName">
		<g:message code="course.courseName.label" default="Course Name" />
		
	</label>
	<g:textField name="courseName" value="${courseInstance?.courseName}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'examType', 'error')} ">
	<label for="examType">
		<g:message code="course.examType.label" default="Exam Type" />
		
	</label>
	<g:textField name="examType" value="${courseInstance?.examType}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'courseTerm', 'error')} ">
	<label for="courseTerm">
		<g:message code="course.courseTerm.label" default="Course Term" />
		
	</label>
	<g:field type="number" name="courseTerm" value="${fieldValue(bean: courseInstance, field: 'courseTerm')}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'entryTerm', 'error')} ">
	<label for="entryTerm">
		<g:message code="course.entryTerm.label" default="Entry Term" />
		
	</label>
	<g:textField name="entryTerm" value="${courseInstance?.entryTerm}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'examNumber', 'error')} ">
	<label for="examNumber">
		<g:message code="course.examNumber.label" default="Exam Number" />
		
	</label>
	<g:textField name="examNumber" value="${courseInstance?.examNumber}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'examNumberB', 'error')} ">
	<label for="examNumberB">
		<g:message code="course.examNumberB.label" default="Exam Number B" />
		
	</label>
	<g:textField name="examNumberB" value="${courseInstance?.examNumberB}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'department', 'error')} ">
	<label for="department">
		<g:message code="course.department.label" default="Department" />
		
	</label>
	<g:select id="department" name="department.id" from="${org.bjou.Department.list()}" optionKey="id" value="${courseInstance?.department?.id}" class="many-to-one" noSelection="['null': '']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'majorLevel', 'error')} ">
	<label for="majorLevel">
		<g:message code="course.majorLevel.label" default="Major Level" />
		
	</label>
	<g:textField name="majorLevel" value="${courseInstance?.majorLevel}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'courseStatus', 'error')} ">
	<label for="courseStatus">
		<g:message code="course.courseStatus.label" default="Course Status" />
		
	</label>
	<g:textField name="courseStatus" value="${courseInstance?.courseStatus}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'currentTerm', 'error')} ">
	<label for="currentTerm">
		<g:message code="course.currentTerm.label" default="Current Term" />
		
	</label>
	<g:textField name="currentTerm" value="${courseInstance?.currentTerm}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'departmentName', 'error')} ">
	<label for="departmentName">
		<g:message code="course.departmentName.label" default="Department Name" />
		
	</label>
	<g:textField name="departmentName" value="${courseInstance?.departmentName}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'user', 'error')} ">
	<label for="user">
		<g:message code="course.user.label" default="User" />
		
	</label>
	<g:select id="user" name="user.id" from="${org.bjou.ShiroUser.list()}" optionKey="id" value="${courseInstance?.user?.id}" class="many-to-one" noSelection="['null': '']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'status', 'error')} ">
	<label for="status">
		<g:message code="course.status.label" default="Status" />
		
	</label>
	<g:field type="number" name="status" value="${fieldValue(bean: courseInstance, field: 'status')}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'jobs', 'error')} ">
	<label for="jobs">
		<g:message code="course.jobs.label" default="Jobs" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${courseInstance?.jobs?}" var="j">
    <li><g:link controller="job" action="show" id="${j.id}">${j?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="job" action="create" params="['course.id': courseInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'job.label', default: 'Job')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'majorName', 'error')} ">
	<label for="majorName">
		<g:message code="course.majorName.label" default="Major Name" />
		
	</label>
	<g:textField name="majorName" value="${courseInstance?.majorName}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'ruleCode', 'error')} ">
	<label for="ruleCode">
		<g:message code="course.ruleCode.label" default="Rule Code" />
		
	</label>
	<g:textField name="ruleCode" value="${courseInstance?.ruleCode}"/>
</div>

